<?php
namespace app\api\controller\v1;
use app\api\model\Banner as BannerModel;
use app\api\validate\IDIntValidate;
use app\lib\exception\BannerException;
class Banner
{
    /*
     * 通过指定$id 获取 banner表 数据
     * @http GET
     * @id banner 表的id
     */
    public function getBanner($id)
    {
        (new IDIntValidate())->goCheck();
       $banner = BannerModel::getBannerId($id);
       if(!$banner){
           throw new BannerException();
       }
       return $banner;

    }
}
